package com.tax.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tax.entity.TdGovCompanyBasic;
import com.tax.entity.TdGovCompanyMobilephone;
import com.tax.mapper.TdGovCompanyMobilephoneMapper;
import com.tax.service.TdGovCompanyMobilephoneService;
import org.junit.platform.commons.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TdGovCompanyMobilephoneServiceImpl extends ServiceImpl<TdGovCompanyMobilephoneMapper, TdGovCompanyMobilephone> implements TdGovCompanyMobilephoneService {

    @Autowired
    private TdGovCompanyMobilephoneMapper baseMapper;

    @Override
    public List<TdGovCompanyMobilephone> getLegalPhone(TdGovCompanyMobilephone entity) {
        QueryWrapper<TdGovCompanyMobilephone> wrapper = new QueryWrapper<>();
        if (StringUtils.isNotBlank(entity.getUnifiedCode())) {
            wrapper.eq("unified_code",entity.getUnifiedCode());
        }
        if (StringUtils.isNotBlank(entity.getValue())) {
            wrapper.eq("value",entity.getValue());
        }
        return baseMapper.selectList(wrapper);
    }
}
